package com.demo.scheduled;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

public class ScheduledDemo {
    public static void main(String[] args) {
        ScheduledExecutorService tast = Executors.newScheduledThreadPool(5);
        ScheduledFuture<?> scheduledFuture = tast.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
            }
        }, 5, 30, TimeUnit.MINUTES);   //5秒后开始执行，然后每隔30秒执行一次


    }
}
